
// 需要这样的格式 yyyy-MM-dd hh:mm:ss
export function dateDetail(datef) {
  let date = new Date(datef);
  let Y = date.getFullYear() + '-';
  let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  let D = date.getDate() + ' ';
  let h = date.getHours() + ':';
  let m = date.getMinutes() + ':';
  let s = date.getSeconds();
  return Y + M + D + h + m + s

}
//yyyy-mm-dd hh:mm:ss 转时间戳
export function datetime_to_unix(datetime){
  var tmp_datetime = datetime.replace(/:/g,'-');
  tmp_datetime = tmp_datetime.replace(/ /g,'-');
  var arr = tmp_datetime.split("-");
  var now = new Date(Date.UTC(arr[0],arr[1]-1,arr[2],arr[3]-8,arr[4],arr[5]));
  return parseInt(now.getTime()/1000);
}
